﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="FestivalMasterDetail.aspx.cs" Inherits="Festival_Locator.FestivalMasterDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="fest_id" DataSourceID="SQLMasterDetail">
    <Columns>
        <asp:BoundField DataField="fest_naam" HeaderText="fest_naam" SortExpression="fest_naam" />
        <asp:BoundField DataField="fest_locatie" HeaderText="fest_locatie" SortExpression="fest_locatie" />
        <asp:BoundField DataField="fest_datum" HeaderText="fest_datum" SortExpression="fest_datum" />
        <asp:BoundField DataField="fest_duur" HeaderText="fest_duur" SortExpression="fest_duur" />
        <asp:CommandField SelectText="Details" ShowSelectButton="True" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SQLMasterDetail" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT * FROM [Festivals]"></asp:SqlDataSource>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="band_id,datum,fest_id" DataSourceID="SqlDataSource1" Height="50px" Width="125px" AllowPaging="True">
        <Fields>
            <asp:BoundField DataField="band_naam" HeaderText="Band naam" ReadOnly="True" SortExpression="band_naam" />
            <asp:BoundField DataField="pod_omschr" HeaderText="Podium naam" ReadOnly="True" SortExpression="pod_omschr" />
            <asp:BoundField DataField="datum" HeaderText="datum" ReadOnly="True" SortExpression="datum" />
            <asp:BoundField DataField="uur" HeaderText="uur" SortExpression="uur" />
        </Fields>
        <PagerSettings Mode="NextPrevious" />
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT [Bands].[band_naam],[BandsPerFestival].[band_id], [BandsPerFestival].[pod_id], [datum], [uur], [fest_id],[Podia].[pod_omschr] FROM [Bands],[BandsPerFestival],[Podia] WHERE ([fest_id] = @fest_id and [BandsPerFestival].[band_id]=[Bands].[band_id] and [BandsPerFestival].[pod_id]=[Podia].[pod_id])">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="fest_id" PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
</asp:Content>
